package org.example.stockdemo.config;

/**
 * author :v-zhousq04
 * description: TODO
 * create date: 2018/3/14 14:56
 * last modify by:v-zhousq04
 */

public class R<T> {
    private String msg;
    private T data;
    private String code;

    public R() {
    }

    public R(T data, String msg, String code) {
        this.msg = msg;
        this.data = data;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static R ok(Object result){
        return new R(result, "ok", "0000");
    }
    public static R ok(Object result,String msg){
        return new R(result, msg, "0000");
    }


    public static R fail(String msg){
        return new R("",msg, "1111");
    }
}
